//-----------------------------------------------------------------------
//
//	Copyright 2002 e Professional Corporation.  All Rights Reserved.
//
//	File:	EproDBPooledConnection.java
//
//	Author:	Manz
//
//	Date:	13/08/2002
//
//-----------------------------------------------------------------------

/*
	This simply wraps a JDBC Connection object in a class that holds the Connection and a flag that determines if the Connection is in use or not.
*/
package com.epro.standard.frontend.util;

public final class EproDBPooledConnection implements java.io.Serializable {

    //	Real JDBC Connection
    private java.sql.Connection connection = null;
    //	boolean flag used to determine if connecion is in use
    private boolean inUse = false;

    public EproDBPooledConnection(java.sql.Connection connection) {
        this.connection = connection;
    }

    public java.sql.Connection getConnection() {
        this.inUse = true;
        return this.connection;
    }

    public void releaseConnection() {
        this.inUse = false;
    }

    public boolean getInUse() {
        return this.inUse;
    }

    public boolean isClose() throws java.sql.SQLException {
        return this.connection.isClosed();
    }

    public void close() throws java.sql.SQLException {
        this.connection.close();
    }
}
